package Grantsfire::Controller::Cms;

use strict;
use warnings;
use base 'Catalyst::Controller';

=head1 NAME

Grantsfire::Controller::Cms - Catalyst Controller

=head1 DESCRIPTION

Catalyst Controller.

=head1 METHODS

=cut


=head2 index 

=cut

sub default :Path {
    my ( $self, $c ) = @_;

    my $file = $c->req->path;
    $file =~ s/^cms\///;
    if (-e Grantsfire->config->{root} . "/$file.html") {
        $c->stash->{file} = "$file.html";
        $c->stash->{template} = 'cms.tt';
    }
    else {
        $c->response->status(404);
        $c->stash->{template} = "404.tt";
    }
}

=head1 AUTHOR

Eugene Eric Kim,,,

=head1 LICENSE

This library is free software, you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

1;
